{{define "title"}}
    Present
{{end}}

{{define "content"}}
    {{ if .Error }}
        <div class="jumbotron">
            <p>{{ .Error }}</p>
        </div>
    {{ else }}
        {{ if (eq .Block.Owner .User.AddressHex )}}
            <div class="jumbotron">
                <div class="col-10 mx-auto">
                    <form method="POST" action="/blockchain/presents/do/{{ .Block.Id }}">
                        <div class="form-group">
                            <input type="text" class="form-control" name="address" placeholder="Address">
                        </div>
                        <input type="submit" class="btn btn-success w-100" name="submit" value="Send present">
                    </form>
                </div>
            </div>
        {{ end }}
    	<table border="1">
            <tr>
                <th>Id</th>
                <td width="100%">{{ .Block.Id }}</td>
            </tr>
            <tr>
                <th>Owner</th>
                <td width="100%">{{ .Block.Owner }}</td>
            </tr>
            <tr>
                <th>Info</th>
                <td width="100%">{{ .Block.Info }}</td>
            </tr>
            <tr>
                <th>Squere</th>
                <td width="100%">{{ .Block.Squere }}</td>
            </tr>
            <tr>
                <th>UsefulSquere</th>
                <td width="100%">{{ .Block.UsefulSquere }}</td>
            </tr>
            <tr>
                <th>RenterAddress</th>
                <td width="100%">{{ .Block.RenterAddress }}</td>
            </tr>
            <tr>
                <th>PresentStatus</th>
                <td width="100%">{{ .Block.PresentStatus }}</td>
            </tr>
            <tr>
                <th>SaleStatus</th>
                <td width="100%">{{ .Block.SaleStatus }}</td>
            </tr>
            <tr>
                <th>RentStatus</th>
                <td width="100%">{{ .Block.RentStatus }}</td>
            </tr>
        </table>
    {{ end }}
{{end}}
